<?php

/*
 * This file belongs to Techno Web Solutions :: http://technowebsol.com
 */
/* Sep 13, 2012
 * File: autoPrepend.php
 * Encoding: UTF-8
 * Project: fbClone
 *
 * @author Suman Choudhury <suman@technowebsol.com>
 *
 * */
 echo "bhfb";
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);
$BASEPATH = dirname(__FILE__);
DEFINE("BASEPATH", $BASEPATH."/");
DEFINE('DEBUG', TRUE);

DEFINE("CONFIG_PATH", BASEPATH."config/");
DEFINE("LIBRARY_PATH", BASEPATH."library/");
DEFINE("MySQL_PATH", BASEPATH."library/mysql/");
DEFINE("MODEL_PATH", BASEPATH."model/");
DEFINE("CONTROLLER_PATH", BASEPATH."controller/");
DEFINE("THEME_PATH", BASEPATH."themes/");

define('EXT', '.php');

$incpath = PATH_SEPARATOR.BASEPATH . PATH_SEPARATOR.CONFIG_PATH . PATH_SEPARATOR.LIBRARY_PATH . PATH_SEPARATOR.
        MODEL_PATH . PATH_SEPARATOR.CONTROLLER_PATH . PATH_SEPARATOR.THEME_PATH.PATH_SEPARATOR.MySQL_PATH;

ini_set('include_path',ini_get('include_path'). $incpath );


function __autoload($class_name) {
    $path = strtolower($class_name) . EXT;
    //echo $path."<br>";
    require_once $path;
    /*if(file_exists($path)){
        require_once $path;
    }
    else{
        if(defined('DEBUG')){
            echo "$path file not found!";
        }
    }*/
}

if(!function_exists("pr")){
    function pr($data, $isDie=true){
        echo "<pre>";
        print_r($data);
        echo "</pre>";
        if($isDie)die();
    }
}
?>
